import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import diretives from '@/utils/directives.js'
// 引入移动端适配插件
import 'amfe-flexible'
// 路由守卫
import '@/utils/permission.js'
import hljs from 'highlight.js' // hljs对象
import 'highlight.js/styles/default.css' // 代码高亮的样式

// 按需导入
import './VantRegister'
// import { allChannelListAPI } from '@/api'
// import { NavBar, Lazyload, Loading, DatetimePicker, Dialog, Image, CellGroup, Tag, Divider, Badge, Search, Row, Col, Popup, List, ActionSheet, PullRefresh, Form, Field, Button, Tabbar, TabbarItem, Icon, Tab, Tabs, Cell } from 'vant'

// Vue.use(Lazyload)

// Vue.use(Loading)
// Vue.use(DatetimePicker)

// Vue.use(Dialog)

// Vue.use(Image)
// Vue.use(CellGroup)
// Vue.use(Tag)

// Vue.use(Divider)

// Vue.use(diretives)
// Vue.use(Search)

// Vue.use(Badge)
// Vue.use(Row)
// Vue.use(Col)

// Vue.use(Popup)

// Vue.use(ActionSheet)
// Vue.use(PullRefresh)

// Vue.use(List)

// Vue.use(Cell)

// Vue.use(Tab)
// Vue.use(Tabs)

// Vue.use(Icon)

// Vue.use(Tabbar)
// Vue.use(TabbarItem)

// Vue.use(Button)

// Vue.use(Form)
// Vue.use(Field)

// Vue.use(NavBar)

Vue.config.productionTip = false

Vue.directive('highlight', function (el) { // 自定义一个代码高亮指令
  const highlight = el.querySelectorAll('pre, code') // 获取里面所有pre或者code标签
  highlight.forEach((block) => {
    hljs.highlightElement(block) // 突出显示这些标签(以及内部代码, 会自动识别语言)
  })
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

/* const myFn = async () => {
  try {
    await allChannelListAPI()
  } catch (err) {
    console.dir(err)
  }
}

myFn() */
